<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
    >
      <el-row>
        <el-col :span="16">
          <el-form-item label="批号" prop="batchNo">
            <el-input
              v-model="queryParams.batchNo"
              placeholder="请输入批号"
              clearable
            />
          </el-form-item>
          <el-form-item label="起始时间" prop="startTime">
            <el-date-picker
              v-model="queryParams.startTime"
              type="datetime"
              format="yyyy-MM-dd HH:mm"
              placeholder="选择日期时间"
              :value-format="'yyyy-MM-dd HH:mm'"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="截止时间" prop="endTime">
            <el-date-picker
              v-model="queryParams.endTime"
              type="datetime"
              format="yyyy-MM-dd HH:mm"
              placeholder="选择日期时间"
              :value-format="'yyyy-MM-dd HH:mm'"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              >查询</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="8">
      <el-col :span="1" class="check-radio">
        <el-radio-group v-model="radioValue" @input="switchType">
          <el-radio :label="1">点数</el-radio>
          <el-radio :label="2">时长</el-radio>
          <el-radio :label="3">航程</el-radio>
        </el-radio-group>
      </el-col>
      <el-col :span="11">
        <div style="height: 500px" ref="lineCharts" id="lineCharts"></div>
      </el-col>
      <el-col :span="12">
        <div style="height: 500px" ref="heatMap" id="heatMap"></div>
      </el-col>
    </el-row>
    <el-row style="margin-top: 10px">
      <el-col :span="24">
        <el-table v-loading="loading" :data="historyArea">
          <el-table-column
            prop="areaId"
            label="批号"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="radarArea"
            label="8203（装备）航迹点数"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="correctRate"
            label="8203（装备）航迹时长"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="locationDeviation"
            label="8203（装备）航迹航程"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="distanceDeviation"
            label="是否匹配到多个通道"
            align="center"
          ></el-table-column>
          <el-table-column
            label="操作"
            align="center"
            class-name="small-padding fixed-width"
          >
            <template slot-scope="scope">
              <el-button
                v-if="scope.row.parentId != 0"
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDisplayMapForEvalution(scope.row)"
                >展示</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import * as echarts from "echarts";
import "@/assets/styles/dataoverview.scss";
import moment from "moment";
import { worldMap } from "@/assets/mapJson/worldMap";
import { nameMapData } from "@/assets/mapJs/common";
//注册中国地图
echarts.registerMap("worldMap", worldMap, {});
import {
  getDataoverViewList,
  getListPathByFlightType,
  getDict,
  getFlightFrequencyList,
  getListByUniqueBatchNoList,
  getListAreaStat,
  getStatAreaHourDeviation,
  getItineraryMap,
  getTestEstimateList,
} from "@/api/service";
export default {
  name: "",
  components: {},
  data() {
    return {
      loading: false,
      radioValue: 1,
      // 显示搜索条件
      showSearch: true,
      tabsValue: "",
      hotDoatData: [], //热力图数据
      listDatas: [],
      switchData: [],
      switchXData: [], //横坐标
      itineraryMapData: [], //航迹的三维数组
      flightDotData: [],
      historyArea: [],
      recordData: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        startTime: moment().subtract(1, "days").format("YYYY-MM-DD HH:mm"),
        endTime: moment(new Date()).format("YYYY-MM-DD HH:mm"),
        batchNo: "",
      },
      mapGeoData: null,
      forChartsMapData: [],
      echartsData: [],
      data: [],
      leftEchartsData: [],
      dataList: [],
      //展示弹窗
      modalListFromArea: [],
      modelOpen: false,
      total: 0,
    };
  },
  mounted() {
    getDict("channel_type").then((res) => {
      console.log("channel_type", res.data);
      if (res.code === 200) {
        const data = res.data.map((item) => {
          return {
            value: item.dictValue,
            label: item.dictLabel,
          };
        });
        this.channels = data;
      }
    });
    this.initEcharts();
    this.getList();
  },
  methods: {
    initEcharts() {
      //line  lineCharts
      const lineCharts = echarts.init(this.$refs.lineCharts);
      let lineOption = {
        tooltip: {},
        xAxis: {
          type: "category",
          data: this.switchXData,
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: this.switchData,
            type: "bar",
            showBackground: true,
            backgroundStyle: {
              color: "rgb(180,180,180,0.2)",
            },
            itemStyle: {
              normal: {
                color: function (params) {
                  if (params.name == 8203) {
                    return "#FA897B";
                  } else if (params.name == 6233) {
                    return "#4675C0";
                  } else {
                    return "#D0E6A5";
                  }
                },
              },
            },
          },
        ],
      };
      document
        .getElementById("lineCharts")
        .removeAttribute("_echarts_instance_");
      lineCharts.setOption(lineOption);

      //热力图
      const heatMap = echarts.init(this.$refs.heatMap);
      let _zoom = 6;
      let _center = [124.775265, 34.849163];
      let heatMapOption = {
        backgroundColor: "#1a203a",
        title: {
          text: "航迹叠加图",
          subtext: "",
          left: "center",
          textStyle: {
            color: "#fff",
          },
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "vertical",
          top: "bottom",
          left: "right",
          textStyle: {
            color: "#fff",
          },
          selectedMode: "multiple",
        },
        nameMap: nameMapData,
        geo: {
          map: "worldMap",
          label: {
            emphasis: {
              show: true,
              color: "#fff",
            },
          },
          regions: [
            {
              name: "南海诸岛",
              itemStyle: {
                // 隐藏地图
                normal: {
                  opacity: 0, // 为 0 时不绘制该图形
                },
              },
              label: {
                show: false, // 隐藏文字
                fontSize: 0,
              },
            },
          ],
          // 把中国地图放大了1.2倍
          zoom: _zoom,
          roam: true,
          animationDurationUpdate: 0,
          center: _center,
          itemStyle: {
            normal: {
              // 地图省份的背景颜色
              areaColor: "rgba(20, 21, 87,0.6)",
              borderColor: "#195BB9",
              borderWidth: 1,
            },
            emphasis: {
              areaColor: "#2B91B7",
            },
          },
        },
        series: this.flightDotData.length > 0 ? this.seriesFormatShow() : {},
      };
      document.getElementById("heatMap").removeAttribute("_echarts_instance_");
      heatMap.setOption(heatMapOption);
    },

    //初始化关联数据显示
    getHistoryListAreaStat() {
      getListAreaStat(this.queryParams).then((res) => {
        console.log("初始化关联数据显示:", res);
        if (res.code === 200) {
          this.historyArea(res.data);
        }
      });
    },

    //根据选择处理的枚举类型
    switchType(val) {
      console.log(504, val);
    },
    seriesFormatShow() {
      let series = [];
      this.flightDotData &&
        this.flightDotData
          .filter((item) => {
            return item?.length > 0;
          })
          //过滤数据空的航迹点
          .map((iten) => {
            if (iten.length > 1) {
              series.push(
                {
                  type: "lines", //第一条实线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "block",
                    width: 2,
                  },
                  effect: {
                    //线特效，小飞机
                    constantSpeed: 10,
                    show: true,
                    color: "yellow", //#00EAFF
                    symbolSize: 15,
                    symbol: planePath,
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  type: "lines", //第二条虚线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "#fff",
                    width: 2,
                    type: "dashed",
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                }
              );
            }
          });

      this.flightDotData1 &&
        this.flightDotData1
          .filter((item) => {
            return item?.length > 0;
          })
          .map((iten) => {
            if (iten.length > 1) {
              series.push(
                {
                  type: "lines", //第一条实线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "block",
                    width: 2,
                  },
                  effect: {
                    //线特效，小飞机
                    constantSpeed: 10,
                    show: true,
                    color: "red", //#00EAFF
                    symbolSize: 15,
                    symbol: planePath,
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  type: "lines", //第二条虚线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "#fff",
                    width: 2,
                    type: "dashed",
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  // name: '基地',
                  type: "effectScatter",
                  coordinateSystem: "geo",
                  data: convertData(forChartsMapData),
                  colorBy: "data",
                  zlevel: 2,
                  rippleEffect: {
                    period: 4,
                    scale: 4,
                    brushType: "stroke",
                  },
                  symbolSize: 6,
                  symbol: "circle",
                  label: {
                    normal: {
                      show: true, //显示市区标签
                      textStyle: { color: "#ccc", fontSize: "16px" }, //省份标签字体颜色
                      formatter: (params) => {
                        return params?.data?.[3];
                      },
                      position: ["-130%", "150%"],
                    },
                    emphasis: {
                      //对应的鼠标悬浮效果
                      show: false, //关闭文字 （这东西有问题得关）
                      textStyle: { color: "transparent" },
                    },
                  },
                  // itemStyle: {
                  //   normal: {
                  //     borderWidth: 7, //区域边框宽度
                  //     borderColor: '#fc8452', //区域边框颜色
                  //     areaColor: '#fc8452', //区域颜色
                  //   },
                  // },
                }
              );
            }
          });

      series.push({
        type: "lines",
        polyline: true,
        coordinateSystem: "geo",
        lineStyle: {
          type: "dashed",
          color: "yellowGreen",
          width: 2,
          opacity: "0.5",
        },
        effect: {
          show: true,
          trailLength: 0.1,
          symbol: "none",
          symbolSize: 8,
        },
        data: this.historyArea,
      });
      return series;
    },

    //历史的区域展示
    handleDisplayMapModal(row) {
      let data = {
        areaId: row.areaId,
        endTime: this.queryParams.endTime,
        startTime: this.queryParams.startTime,
        sourceId: this.queryParams.sourceId,
      };
      getStatAreaHourDeviation(data).then((res) => {
        if (res.code === 200) {
          this.modalListFromArea(res.data);
          this.modelOpen = true;
        }
      });
    },

    handleDisplayMapForEvalution(record) {
      let uniqueBatchNoArray = [];
      uniqueBatchNoArray.push(record?.uniqueBatchNo);
      if (record?.newChildren?.length > 0) {
        record?.newChildren.map((item) => {
          uniqueBatchNoArray.push(item?.uniqueBatchNo);
        });
      }
      this.recordData = record;
      switchType(chkSelectIndex, record);

      let dataStr =
        uniqueBatchNoArray.length > 0 ? uniqueBatchNoArray.join(",") : "";
      getItineraryMap({
        uniqueBatchNos: dataStr,
      }).then((res) => {
        if (res.code == 200) {
          let dataAll = res.data.map((iten) => {
            return iten?.locationRadar?.map((item) => {
              if (item?.longitude && item?.latitude) {
                return [item?.longitude, item?.latitude, item.sourceId];
              }
            });
          });
          this.itineraryMapData = dataAll;
        } else {
          message.warning(res.msg);
        }
      });
    },
    seriesFormatShow() {
      let series = [];
      this.flightDotData &&
        this.flightDotData
          .filter((item) => {
            return item?.length > 0;
          })
          //过滤数据空的航迹点
          .map((iten) => {
            if (iten.length > 1) {
              series.push(
                {
                  type: "lines", //第一条实线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "block",
                    width: 2,
                  },
                  effect: {
                    //线特效，小飞机
                    constantSpeed: 10,
                    show: true,
                    color: "yellow", //#00EAFF
                    symbolSize: 15,
                    symbol: planePath,
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  type: "lines", //第二条虚线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "#fff",
                    width: 2,
                    type: "dashed",
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                }
              );
            }
          });

      this.flightDotData1 &&
        this.flightDotData1
          .filter((item) => {
            return item?.length > 0;
          })
          .map((iten) => {
            if (iten.length > 1) {
              series.push(
                {
                  type: "lines", //第一条实线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "block",
                    width: 2,
                  },
                  effect: {
                    //线特效，小飞机
                    constantSpeed: 10,
                    show: true,
                    color: "red", //#00EAFF
                    symbolSize: 15,
                    symbol: planePath,
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  type: "lines", //第二条虚线
                  coordinateSystem: "geo", // 这句的意思是连线是基于地理坐标的,geo组件将在下面给出
                  polyline: true, // 这表示连线是否为多端点的连线
                  data: [
                    {
                      coords: iten,
                    },
                  ],
                  lineStyle: {
                    color: "#fff",
                    width: 2,
                    type: "dashed",
                  },
                  progressiveThreshold: 500,
                  progressive: 200,
                },
                {
                  // name: '基地',
                  type: "effectScatter",
                  coordinateSystem: "geo",
                  data: convertData(forChartsMapData),
                  colorBy: "data",
                  zlevel: 2,
                  rippleEffect: {
                    period: 4,
                    scale: 4,
                    brushType: "stroke",
                  },
                  symbolSize: 6,
                  symbol: "circle",
                  label: {
                    normal: {
                      show: true, //显示市区标签
                      textStyle: { color: "#ccc", fontSize: "16px" }, //省份标签字体颜色
                      formatter: (params) => {
                        return params?.data?.[3];
                      },
                      position: ["-130%", "150%"],
                    },
                    emphasis: {
                      //对应的鼠标悬浮效果
                      show: false, //关闭文字 （这东西有问题得关）
                      textStyle: { color: "transparent" },
                    },
                  },
                }
              );
            }
          });

      series.push({
        type: "lines",
        polyline: true,
        coordinateSystem: "geo",
        lineStyle: {
          type: "dashed",
          color: "yellowGreen",
          width: 2,
          opacity: "0.5",
        },
        effect: {
          show: true,
          trailLength: 0.1,
          symbol: "none",
          symbolSize: 8,
        },
        data: this.historyArea,
      });
      return series;
    },

    //历史关联数据
    handleDisplayMap(record) {
      let data = {
        uniqueBatchNo: record?.uniqueBatchNo,
      };
      getListByUniqueBatchNoList(data).then((res) => {
        console.log(502, res);
        if (res.code == 200) {
          this.leftEchartsData = res.data?.locationRadarDeviations || [];
          let showItnerList = res.data?.locationRadar?.map((item) => {
            return [item?.longitude, item?.latitude, item?.locationDeviation];
          });
          let showItnerList1 = res.data?.locationRadar?.map((item) => {
            return [item?.longitude, item?.latitude];
          });
          //添加辅助飞行线
          let showItnerList2 = res.data?.locationReals?.map((item) => {
            return [item?.longitude, item?.latitude];
          });
          this.leftTableList = res.data?.locationRadarDeviations || [];
          this.newDataPlane = res.data?.locationRadarDeviations
            ? res.data?.locationRadarDeviations.reverse()
            : [];
          if (historyList.length > 0) {
            this.showHistoryList = showItnerList;
            this.showHistoryList1 = [showItnerList1];
            this.showHistoryList2 = [showItnerList2];
          } else {
            this.showHistoryList = [];
            this.showHistoryList1 = [];
            this.showHistoryList2 = [];
          }
        }
      });
    },
    //将数据处理给到航迹
    getItineraryData() {
      let data = this.newDataPlane.map((item) => {
        if (item?.longitude && item?.latitude) {
          return [item?.longitude, item?.latitude];
        }
      });
      console.log(620, data);
      this.flightDotData.push(data);
      console.log(621, this.flightDotData);
    },

    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList();
    },
    getList() {
      getTestEstimateList(this.queryParams).then((res) => {
        console.log("list", res);
        if (res.code === 200) {
          this.total = res.total;
          let dataSouce = [];
          res.rows.map((item) => {
            let objSpot = {};
            objSpot["newChildren"] = [];
            item.map((iten) => {
              if (iten.sourceId == 8203) {
                objSpot["batchNo"] = iten?.batchNo;
                objSpot["id"] = iten?.uniqueBatchNo + Math.random();
                objSpot["trackNum"] = iten?.trackNum;
                objSpot["trackTime"] = iten?.trackTime;
                objSpot["distance"] = iten?.distance;
                objSpot["uniqueBatchNo"] = iten?.uniqueBatchNo;
              } else {
                objSpot["newChildren"].push(iten);
              }
              dataSouce.push(objSpot);
            });
          });
          let data1 = dataSouce.filter((item) => {
            if (Object.keys(item).length !== 0) {
              return true;
            }
            return false;
          });
          //根据id删除多余的
          let newArr = distinct(data1, "id");
          setQueryNowList(newArr);
        } else {
          message.warning(res?.msg);
          setQueryNowList([]);
        }
      });
    },
    filterData(value) {
      let data =
        this.frequencyData &&
        this.frequencyData.filter((item) => {
          return item?.dictValue == value;
        });
      console.log("filterData", data[0]?.dictLabel, frequencyData);
      return data[0]?.dictLabel;
    },
    convertData(data) {
      var res = [];
      for (var i = 0; i < data.length; i++) {
        var geoCoord = this.mapGeoData[data[i].name];
        if (geoCoord) {
          res.push(geoCoord.concat(data[i].value).concat(data[i].name));
        }
      }
      return res;
    },
    getMonths() {
      const moment = require("moment");
      for (let i = 2; i >= 0; i--) {
        let lastMonth = moment().subtract(i, "months").month() + 1;
        this.marks.forEach((item) => {
          if (item.value === lastMonth) {
            this.monthList.push(item.label);
          }
        });
      }
      this.tabsValue = this.monthList[this.monthList.length - 1]; // 当前月选中
      console.log("getMonths:", this.tabsValue);
      this.selectSemented(this.tabsValue);
    },
    selectSemented(val) {
      console.log(222, val);
      let year = moment().get("year");
      let month = 0;
      this.marks.forEach((item) => {
        if (item.label === val) {
          console.log(item.value.toString().length);
          month =
            item.value.toString().length < 2
              ? "0" + item.value.toString()
              : item.value.toString();
        }
      });
      let data = {
        statMonth: `${year}-${month}`,
      };
      this.selectStartMonth = moment(`${year}-${month}-01`)
        .startOf("month")
        .format("YYYY-MM-DD");
      this.selectEndMonth = moment(`${year}-${month}-01`)
        .endOf("month")
        .format("YYYY-MM-DD");
      console.log(
        197,
        data,
        this.selectStartMonth,
        this.selectEndMonth,
        this.frequencyData
      );
      // this.setSelectTimeValue(data);
      this.getPageData(data);
    },
    setSelectTimeValue() {},
    getPageData(data) {
      getDataoverViewList(data).then((res) => {
        console.log(res);
        this.barChartsData = { label: [], value: [] };
        this.rabarChartsData = [];
        if (res.code == 200 && res?.data) {
          res.data.dataVolumes.forEach((item) => {
            switch (item.statType) {
              case 0:
                this.sjzl = item.statValue;
                break;
              case 2:
                this.dataVolumes.jcsjj = item.statValue;
                break;
              case 4:
                this.dataVolumes.zlsjj = item.statValue;
                break;
              case 7:
                this.dataVolumes.cssjj = item.statValue;
                break;
              case 5:
                this.dataVolumes.cjsjj = item.statValue;
                break;
              default:
                this.dataVolumes.ctj = item.statValue;
            }
          });
          let params = {
            startTime:
              moment(data.statMonth).startOf("month").format("YYYY-MM-DD") ||
              moment().startOf("month").format("YYYY-MM-DD"),
            endTime:
              moment(data.statMonth).endOf("month").format("YYYY-MM-DD") ||
              moment().endOf("month").format("YYYY-MM-DD"),
            flightType: res?.data?.targetTypeTops?.[0]?.flightType,
          };
          if (res?.data?.targetTypeTops?.[0]?.flightType) {
            console.log(411, params);
            // getFrequencyListHandle(params);
            this.handleGetListPathByFlightType(params);
            let echartsData = (this.echartsData = res.data.targetTypeTops.slice(
              0,
              5
            ));
            console.log("echartsdata:", echartsData);
            if (echartsData.length > 0) {
              echartsData.forEach((item) => {
                let label = "";
                this.frequencyData.forEach((item1) => {
                  // console.log(item.flightType, "=====", item1.dictCode);
                  if (item.flightType == item1.dictCode) {
                    label = item1.dictLabel;
                  } else {
                    label = "";
                  }
                });
                // Top6
                this.barChartsData.label.push(label);
                this.barChartsData.value.push(item.exploreNum);

                //雷达
                this.rabarChartsData.push({
                  name: label,
                  max: item.exploreNum + 30,
                });

                //扇形
                this.pieChartsData.push({
                  name: label,
                  value: item.exploreNum,
                });

                // 词云图
                this.wordChartsData.push({
                  name: label,
                  value: Math.sqrt(item.exploreNum * 0.4) * 5,
                });
              });
              this.initEcharts();
            }
          }
        } else {
          this.$modal.msgSuccess("未查询到数据");
        }
      });

      let params = {
        startTime: this.selectStartMonth,
        endTime: this.selectEndMonth,
        flightType: this.frequencyData[0].dictSort,
      };
      console.log("this.frequencyData", this.frequencyData, params);
      getFlightFrequencyList(params).then((res) => {
        console.log("getFlightFrequencyList", res);
        if (res.code == 200 && res.data) {
          this.frequencyDataBar = res.data;
          let dataSource = res?.data?.frequencyNames
            .map((item, index) => {
              return {
                value: res?.data?.frequencyNums[index],
                name: res?.data?.frequencyNames[index],
              };
            })
            ?.sort((a, b) => a.value - b.value); //从小到大排序
          this.pieData = dataSource;
          this.initEchartsRight();
        }
      });
    },
    //频率
    //获取飞行航迹的展示
    handleGetListPathByFlightType(params) {
      getListPathByFlightType(params).then((res) => {
        if (res.code == 200) {
          let dataSouce3 = [];
          let dataSouce2 = res?.data
            ?.map((item) => {
              return item?.locationList?.map((iten) => {
                return [iten?.longitude, iten?.latitude, undefined];
              });
            })
            .filter((itex) => {
              return itex;
            })
            .map((itey) => {
              console.log(2222, itey);
              return dataSouce3.push(...itey);
            });
          console.log("hotDoatData:", dataSouce3);
          this.hotDoatData = dataSouce3;
          this.initEchartsHot();
        }
      });
    },
    radarBtnClick(val) {
      console.log("radarBtnClick", val);
      switch (val) {
        case "editFlowChart":
          this.$router.push({
            path: "/dataAnalysis/editFlowChart",
            query: {},
          });
          break;
        case "radarSpectrum":
          this.$router.push({
            path: "/dataAnalysis/spotevalution8203",
            query: {},
          });
          break;
        case "radarPlot":
          this.$router.push({
            path: "/dataAnalysis/spotevalutionyangben",
            query: {},
          });
          break;
        case "matchingRelation":
          this.$router.push({
            path: "/dataAnalysis/relateform",
            query: {},
          });
          break;
      }
    },
  },
};
</script>
<style scoped>
.check-radio {
  height: 500px;
  line-height: 500px;
}
.check-radio .el-radio-group .el-radio {
  height: 26px;
  line-height: 26px;
}
</style>
